<template>
  <div>
    <el-col :span="2" style="right: auto">
      <el-button  size="small" type="success" @click="addClick">新增字段</el-button>
    </el-col>
    <el-table highlight-current-row :data="CreatorsTableData" border  stripe height="500px">

      <el-table-column label="NAME" min-width="200" prop="name">
        <template slot-scope="scope">
          <el-input style="width: 150px" v-model="scope.row.name" :disabled="scope.row.nameEnable" @change="((value) => {selectName(value, scope.$index)})">
          </el-input>
        </template>
      </el-table-column>
      <el-table-column label="ROLE" min-width="200" prop="role">
        <template slot-scope="scope">
          <el-input style="width: 150px" v-model="scope.row.role" :disabled="scope.row.role" @change="((value) => {selectName(value, scope.$index)})">
          </el-input>
        </template>
      </el-table-column>
      <el-table-column label="INSTITUTION" min-width="200" prop="institution">
        <template slot-scope="scope">
          <el-input style="width: 350px" v-model="scope.row.institution" :disabled="scope.row.institutionEnable" @change="((value) => {selectName(value, scope.$index)})">
          </el-input>
        </template>
      </el-table-column>
      <el-table-column label="操作" min-width="150" >
        <template slot-scope="scope">
          <span><el-link type="primary" @click.prevent="add(scope.$index)">添加</el-link></span>
          <span><el-link type="primary" @click.prevent="update(scope.$index)">编辑</el-link></span>
          <span><el-link type="danger" @click="deleteItem(scope.$index)">删除</el-link></span>
        </template>
      </el-table-column>
    </el-table>

  </div>
</template>

<script>
    export default {
        name: "CreatorsTableData"
    }
</script>

<style scoped>

</style>
